unit altsenhas2_unt;

interface

uses
  Funcoes,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DBCtrls, ExtCtrls, Buttons, IBServices, IBEvents,
  IBSQLMonitor, IBDatabaseInfo;

type
  Taltsenhas2_frm = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    btnAlterar: TBitBtn;
    btnFechar: TBitBtn;
    IBSecurityService1: TIBSecurityService;
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    Bevel1: TBevel;
    Label4: TLabel;
    Edit4: TEdit;
    Label5: TLabel;
    Edit5: TEdit;
    Label6: TLabel;
    Edit6: TEdit;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure btnFecharClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  altsenhas2_frm: Taltsenhas2_frm;

implementation

{$R *.dfm}

uses principal_unt, DMSistema_unt;

procedure Taltsenhas2_frm.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  altsenhas2_frm := nil;
  action := cafree;
end;

procedure Taltsenhas2_frm.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if key = #13 then
  begin
    key := #0;
    selectnext(twincontrol(sender),true,true);
  end;
end;

procedure Taltsenhas2_frm.btnFecharClick(Sender: TObject);
begin
   Close;
end;

procedure Taltsenhas2_frm.FormCreate(Sender: TObject);
begin
   with IBSecurityService1 do
   begin
      try
         Close;
         ServerName := DMSistema_frm.IP;
         Params.Clear;
         Params.Add('user_name='+DMSistema_frm.User);
         Params.Add('password='+DMSistema_frm.Pass);
      except
      end;
   end;
end;

end.

